﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EKETEAM.FrameWork;

namespace eFrameWork.Customs.Base
{
    public partial class UserCode : System.Web.UI.Page
    {
        public string UserArea = "Application";
        string appitem = eParameters.QueryString("appitem");
        protected void Page_Load(object sender, EventArgs e)
        {
            if (appitem.Length == 0) return;
            eUser user = new eUser(eBase.getUserArea(UserArea));
            eModelInfo modelinfo = new eModelInfo(user);
            eModel model = modelinfo.Model;
            if (modelinfo.Action == "insert")
            {
                string sql = "update a_eke_sysUsers set ParentCode='" + user["UserCode"].ToString() + "',UserCode='" + user["UserCode"].ToString() + "' + cast(BaseCode as varchar(10)) where UserID='" + model.ID + "'";
                eBase.UserInfoDB.ExecuteNonQuery(sql);
            }
        }
    }
}